<html>

<head>
    <meta charset="UTF-8">
    <title>测试页</title>
</head>
<style>
    table {
        width: 700px;
    }

    tr {
        height: 20px;
    }

    td {
        text-indent: 10px;
    }

    * {
        font-size: 10px;
    }

    @media print {
        .Noprint {
            display: none;
        }
        .PageNext {
            page-break-after: always;
        }
    }
</style>

<body>
    <div id='printContent' style="width: 700px;"></div>
</body>

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="Print.js"></script>
<script>
    var RemoteTypeAddress = "https://www.easy-mock.com/mock/5a4d84bee5f9cd651a7fbce4/GSMSprinttest/";
    var pageType = 'salesorder';
    var bills = [5669,5668,5667];
    var typeUrl = RemoteTypeAddress + pageType;
    var dataUrl = "http://222.196.35.4:8088/GSMS/logistics/" + pageType + "/getborder.do?IDS=" + bills.join(';') + ';';
 
    

    $.when( $.ajax(typeUrl), $.ajax(dataUrl) ).done(function(type, data) {      //获取数据
        var typeMape = type[0];
        var pageData = data[0];

        // new 打印类对象
        var print = new Print(typeMape, pageData);
       
        //以下为类的4个配置项
        // print.isPagination = false;  //设置不分页
        // print.repeatPrintAmount = 2; //设置重复打印两次
        // print.tableRowsSize = 8;     //设置每一页打印8行
        // print.tableTopInLineSize = 4;//设置头部一列展示4个数据
        
        var contain = print.getHTML();  //获得生成的HTML字符串

        document.getElementById('printContent').innerHTML = contain;

    }).fail(function(){     //获取数据失败
        alert('获取数据时出错');
    })

</script>

</html>